<!DOCTYPE html>
<html lang="en-us">
  <head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="robots" content="noodp"/>
  <meta name="author" content="Mr.wei">
  
  
  
  <link rel="prev" href="http://blog.mr-wei.cn/2019/cadence-allegro%E5%88%B6%E4%BD%9Cgerber%E6%96%87%E4%BB%B6/" />
  <link rel="next" href="http://blog.mr-wei.cn/2019/ble%E8%BF%9E%E6%8E%A5%E5%8F%82%E6%95%B0/" />
  <link rel="canonical" href="http://blog.mr-wei.cn/2019/nrf52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/" />
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
  <link rel="manifest" href="/site.webmanifest">
  <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
  <meta name="msapplication-TileColor" content="#da532c">
  <meta name="theme-color" content="#ffffff">
  <title>
       
       
           NRF52840例程ble_app_buttonless_dfu添加串口驱动 | Mr.wei
       
  </title>
  <meta name="title" content="NRF52840例程ble_app_buttonless_dfu添加串口驱动 | Mr.wei">
    
  
  <link rel="stylesheet" href="/font/iconfont.css">
  <link rel="stylesheet" href="/css/main.min.css">


  
  
 

<script type="application/ld+json">
 "@context" : "http://schema.org",
    "@type" : "BlogPosting",
    "mainEntityOfPage": {
         "@type": "WebPage",
         "@id": "http:\/\/blog.mr-wei.cn"
    },
    "articleSection" : "posts",
    "name" : "NRF52840例程ble_app_buttonless_dfu添加串口驱动",
    "headline" : "NRF52840例程ble_app_buttonless_dfu添加串口驱动",
    "description" : " 环境  SDK：nRF5_SDK_15.2.0 example：  bootloader:pca10056_ble_debug app:ble_app_uart_c reference app:ble_app_buttonless_dfu  相关硬件  nRF52840-Dongle nRF52840-DK    目的 为SDK中的ble_app_buttonss_dfu例程添加uart驱动\n修改过程 工程修改  添加uart驱动相关文件   添加.h文件搜索路径   sdk_config.h文件修改  使能APP_UART  使能APP_FIFO  修改log输出   main.c文件修改  添加相关头文件  添加相关宏定义  添加uart初始化和接收事件处理  调用uart初始化  测试结果   ",
    "inLanguage" : "en-us",
    "author" : "Mr.wei",
    "creator" : "Mr.wei",
    "publisher": "Mr.wei",
    "accountablePerson" : "Mr.wei",
    "copyrightHolder" : "Mr.wei",
    "copyrightYear" : "2019",
    "datePublished": "2019-09-03 10:32:21 \x2b0800 CST",
    "dateModified" : "2019-09-03 10:32:21 \x2b0800 CST",
    "url" : "http:\/\/blog.mr-wei.cn\/2019\/nrf52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8\/",
    "wordCount" : "26",
    "keywords" : [ "NRF52840", "Mr.wei"]
}
</script>

</head>

  


  <body class="">
    <div class="wrapper">
        <nav class="navbar">
    <div class="container">
        <div class="navbar-header header-logo">
        	<a href="javascript:void(0);" class="theme-switch"><i class="iconfont icon-xihuan"></i></a>&nbsp;<a href="http://blog.mr-wei.cn">Mr.wei</a>
        </div>
        <div class="menu navbar-right">
                
                
                <a class="menu-item" href="/posts/" title="">Blog</a>
                
                <a class="menu-item" href="http://balance.mr-wei.cn" title="">BalanceCar</a>
                
                <a class="menu-item" href="/categories/" title="">Categories</a>
                
                <a class="menu-item" href="/tags/" title="">Tags</a>
                
                <a class="menu-item" href="/about/" title="About">About</a>
                
        </div>
    </div>
</nav>
<nav class="navbar-mobile" id="nav-mobile" style="display: none">
     <div class="container">
        <div class="navbar-header">
            <div>  <a href="javascript:void(0);" class="theme-switch"><i class="iconfont icon-xihuan"></i></a>&nbsp;<a href="http://blog.mr-wei.cn">Mr.wei</a></div>
            <div class="menu-toggle">
                <span></span><span></span><span></span>
            </div>
        </div>
     
          <div class="menu" id="mobile-menu">
                
                
                <a class="menu-item" href="/posts/" title="">Blog</a>
                
                <a class="menu-item" href="http://balance.mr-wei.cn" title="">BalanceCar</a>
                
                <a class="menu-item" href="/categories/" title="">Categories</a>
                
                <a class="menu-item" href="/tags/" title="">Tags</a>
                
                <a class="menu-item" href="/about/" title="About">About</a>
                
        </div>
    </div>
</nav>







    	 <main class="main">
          <div class="container">
      		
<article class="post-warp" itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
        <h1 class="post-title" itemprop="name headline">NRF52840例程ble_app_buttonless_dfu添加串口驱动</h1>
        <div class="post-meta">
                Written by <a itemprop="name" href="http://blog.mr-wei.cn" rel="author">Mr.wei</a> with ♥ 
                <span class="post-time">
                on <time datetime=2019-09-03 itemprop="datePublished">September 3, 2019</time>
                </span>
                in
                <i class="iconfont icon-folder"></i>
                <span class="post-category">
                        
                </span>
        </div>
    </header>
    <div class="post-content">
        

        
            
        

        
        
     
          
          
          

          
          
          

          

<h1 id="环境">环境</h1>

<ul>
<li>SDK：nRF5_SDK_15.2.0</li>
<li>example：

<ul>
<li>bootloader:pca10056_ble_debug</li>
<li>app:ble_app_uart_c</li>
<li>reference app:ble_app_buttonless_dfu</li>
</ul></li>
<li>相关硬件

<ul>
<li>nRF52840-Dongle</li>
<li>nRF52840-DK
<!-- more --></li>
</ul></li>
</ul>

<h1 id="目的">目的</h1>

<p>为SDK中的ble_app_buttonss_dfu例程添加uart驱动</p>

<h1 id="修改过程">修改过程</h1>

<h2 id="工程修改">工程修改</h2>

<ul>
<li>添加uart驱动相关文件</li>
</ul>

<p><figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-27-34.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p>

<ul>
<li>添加.h文件搜索路径
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-33-2.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></li>
</ul>

<h2 id="sdk-config-h文件修改">sdk_config.h文件修改</h2>

<ul>
<li><p>使能APP_UART
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-51-20.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>使能APP_FIFO
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-52-3.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>修改log输出
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-32-21.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>
</ul>

<h2 id="main-c文件修改">main.c文件修改</h2>

<ul>
<li><p>添加相关头文件
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-53-47.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>添加相关宏定义
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/15-54-27.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>添加uart初始化和接收事件处理
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-26-19.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure>
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-26-46.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure>
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-27-3.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>调用uart初始化
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-28-11.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>

<li><p>测试结果
<figure><img src="/images/ring.svg" data-sizes="auto" data-src="http://pan.mr-wei.cn/image/Blog_image/NRF52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/16-28-38.png" alt="" class="lazyload"><figcaption class="image-caption"></figcaption></figure></p></li>
</ul>

    </div>

    <div class="post-copyright">
             
            <p class="copyright-item">
                <span>Author:</span>
                <span>Mr.wei </span>
                </p>
            
           
             
            <p class="copyright-item">
                    <span>Link:</span>
                    <a href=http://blog.mr-wei.cn/2019/nrf52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/>http://blog.mr-wei.cn/2019/nrf52840%E4%BE%8B%E7%A8%8Bble_app_buttonless_dfu%E6%B7%BB%E5%8A%A0%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8/</span>
            </p>
            
             
            <p class="copyright-item lincese">
                本文采用<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" #target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>进行许可
            </p>
            
    </div>

  
    <div class="post-tags">
        
            <section>
            <i class="iconfont icon-tag"></i>Tag(s): 
            
            <span class="tag"><a href="http://blog.mr-wei.cn/tags/nrf52840/">
                    #NRF52840</a></span>
            
            </section>
        
        <section>
                <a href="javascript:window.history.back();">back</a></span> · 
                <span><a href="http://blog.mr-wei.cn">home</a></span>
        </section>
    </div>

    <div class="post-nav">
        
        <a href="http://blog.mr-wei.cn/2019/cadence-allegro%E5%88%B6%E4%BD%9Cgerber%E6%96%87%E4%BB%B6/" class="prev" rel="prev" title="Cadence Allegro制作Gerber文件"><i class="iconfont icon-left"></i>&nbsp;Cadence Allegro制作Gerber文件</a>
         
        
        <a href="http://blog.mr-wei.cn/2019/ble%E8%BF%9E%E6%8E%A5%E5%8F%82%E6%95%B0/" class="next" rel="next" title="BLE连接参数">BLE连接参数&nbsp;<i class="iconfont icon-right"></i></a>
        
    </div>

    <div class="post-comment">
          
                 
          
    </div>
</article>
          </div>
		   </main>
      <footer class="footer">
    <div class="copyright">
        &copy;
        
        <span itemprop="copyrightYear">2018 - 2019</span>
        
        <span class="with-love">
    	 <i class="iconfont icon-love"></i> 
         </span>
         
            <span class="author" itemprop="copyrightHolder"><a href="http://blog.mr-wei.cn">Mr.wei</a> | </span> 
         

         
            <a href="http://www.miibeian.gov.cn/" target="_blank" rel="external nofollow">冀ICP备 - 18032379号 </a> |
         
		  <span>Powered by <a href="https://gohugo.io/" target="_blank" rel="external nofollow">Hugo</a> & <a href="https://github.com/liuzc/leaveit" target="_blank" rel="external nofollow">LeaveIt</a></span> 
    </div>

	
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [['$','$'], ['\\(','\\)']],
            displayMath: [['$$','$$'], ['\[','\]']],
            processEscapes: true,
            processEnvironments: true,
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
            TeX: {
                equationNumbers: { autoNumber: "AMS" },
                extensions: ["AMSmath.js", "AMSsymbols.js"]
            }
        }
    });
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
	
	

</footer>












    
     <link href="//lib.baomitu.com/lightgallery/1.6.11/css/lightgallery.min.css" rel="stylesheet">  
      
     <script src="/js/vendor_gallery.min.js" async="" ></script>
    
  



     </div>
  </body>
</html>
